package ucd.csi.comp30290.fall2011.ebbt;

import java.text.NumberFormat;

public class Coverage {
    
    private static final NumberFormat FMT = NumberFormat.getPercentInstance();
    
    static {
        FMT.setMaximumFractionDigits(2);
    }
    
    private int lines;
    private int branches;
    private double linesCovered;
    private double branchesCovered;
    
    public Coverage(int lines, int branches, double linesCovered, double branchesCovered) {
        this.lines = lines;
        this.branches = branches;
        this.linesCovered = linesCovered;
        this.branchesCovered = branchesCovered;
    }
    
    public int getLines() {
        return lines;
    }
    public int getBranches() {
        return branches;
    }
    
    public double getLinesCovered() {
        return linesCovered;
    }
    public double getBranchesCovered() {
        return branchesCovered;
    }

    @Override
    public String toString() {
        return "Coverage [lines=" + lines + ", branches=" + branches
                + ", linesCovered=" + FMT.format(linesCovered) 
                + ", branchesCovered=" + FMT.format(branchesCovered) + "]";
    }
    
}
